﻿using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using System.Collections.ObjectModel;
using System.Reflection.Metadata;


namespace CommunityToolkitMvvmDemo
{
    public partial class MainViewModel: ObservableObject
    {
        public ObservableCollection<WavePack> WaveDict { get; set; } = new();
        [RelayCommand]
        public void Confirm() {
            Console.WriteLine("Console");
            System.Diagnostics.Trace.WriteLine("Trace");
            System.Diagnostics.Debug.WriteLine("Debug");
            //this.Name = "你123好";
            var pack = new WavePack { WaveLength =190, Parameter = 1 };

            WaveDict.Add(pack);
        }
        [ObservableProperty]
        private string name="你好123";

        [ObservableProperty]
        private string modelNameSearch="XXXXX";


        [RelayCommand]
        private void LostFocus()
        {
            DateTime currentTime = DateTime.UtcNow;
            long unixTimestamp = ((DateTimeOffset)currentTime).ToUnixTimeSeconds();

            this.Name = unixTimestamp+"";
        }


    }

}
